All files / domain/irepositories IUserRepository.js

0% Statements 0/7
100% Branches 0/0
0% Functions 0/6
0% Lines 0/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61                                                                                                                         
/**
 * User Repository Interface
 * Defines contract for user data access
 */
class IUserRepository {
  /**
   * Find user by ID
   * @param {number} id 
   * @returns {Promise<User|null>}
   */
  async findById(id) {
    throw new Error('Method findById() must be implemented');
  }
 
  /**
   * Find user by email
   * @param {string} email 
   * @returns {Promise<User|null>}
   */
  async findByEmail(email) {
    throw new Error('Method findByEmail() must be implemented');
  }
 
  /**
   * Find all users
   * @returns {Promise<User[]>}
   */
  async findAll() {
    throw new Error('Method findAll() must be implemented');
  }
 
  /**
   * Create new user
   * @param {User} user 
   * @returns {Promise<User>}
   */
  async create(user) {
    throw new Error('Method create() must be implemented');
  }
 
  /**
   * Update existing user
   * @param {User} user 
   * @returns {Promise<User>}
   */
  async update(user) {
    throw new Error('Method update() must be implemented');
  }
 
  /**
   * Delete user by ID
   * @param {number} id 
   * @returns {Promise<boolean>}
   */
  async delete(id) {
    throw new Error('Method delete() must be implemented');
  }
}
 
module.exports = IUserRepository;